package com.gusha.utils;

import java.io.Serializable;

/**
 * @Description: json结果
 * 
 */
public class JsonResult implements Serializable {
	/**
	 * @Fields serialVersionUID :
	 */
	private static final long serialVersionUID = 1L;

	// 是否成功
	private boolean flag;
	// 信息
	private String msg;

	// 返回码
	private String code;

	public boolean isFlag() {
		return flag;
	}

	public void setFlag(boolean flag) {
		this.flag = flag;
	}

	// 附加信息对象
	private Object obj;

	public JsonResult(String code) {
		this.code = code;
	}

	public JsonResult(String code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public JsonResult(String msg, String code, Object obj) {
		super();
		this.msg = msg;
		this.code = code;
		this.obj = obj;
	}

	public JsonResult(boolean b) {
		super();
		this.flag = b;
		if (b) {
			this.msg = "操作成功";
		} else {
			this.msg = "操作失败";
		}

		
	}

	public JsonResult(boolean flag, String msg) {
		super();
		this.flag = flag;
		this.msg = msg;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getObj() {
		return obj;
	}

	public void setObj(Object obj) {
		this.obj = obj;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

}
